﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LiveFrameworkExplorer.Plugins.SearchPlugin
{
    public class SearchPlugin : IPlugin, IPluginBar
    {
        private ILFEBase _lfeBase;

        #region IPlugin Members

        public void Init(ILFEBase lfeBase)
        {
            _lfeBase = lfeBase;
        }

        public string GetPluginLabel()
        {
            return "Search";
        }

        public System.Drawing.Image GetPluginImage()
        {
            return LiveFrameworkExplorer.Properties.Resources.Search;
        }

        public void OpenPlugin()
        {
            //object ucSearch = null;
            //var vsWin = _lfeBase.CreateWindowToolbox(this, typeof(ucSearchComposition).FullName,
            //    "Search in Live Framework", "{6AE5FBCB-E18B-469f-993B-C85DC3DCB144}", ref ucSearch);
            //(ucSearch as ucSearchComposition).Init(_lfeBase);
            //vsWin.IsFloating = true;
            //vsWin.Linkable = false;
            //vsWin.Visible = true;
            System.Windows.Forms.MessageBox.Show("Under development !");
        }

        public PluginBarStatus QueryStatus(LFEState state)
        {
            switch (state)
            { 
                case LFEState.None:
                    return PluginBarStatus.Invisble;
                case LFEState.Local:
                case LFEState.Mesh:
                    return PluginBarStatus.Enable;
                default:
                    return PluginBarStatus.Disable;
            }
        }

        #endregion
    }
}
